import request from "./request";
//获取用户列表测试
var getusers = query => {
	return new Promise((res, rej) => {
		request.get('/index/index/index', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}

//获取验证码
var getmassage = query => {
	return new Promise((res, rej) => {
		request.get('/index/index/getcode', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}
//注册
var adduser = query => {
	return new Promise((res, rej) => {
		request.post('/index/index/register', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}
//登录
var loaded = query => {
	return new Promise((res, rej) => {
		request.post('/index/index/login', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}
//获取超级企业列表
var getlist = query => {
	return new Promise((res, rej) => {
		request.get('/index/call/getsuperes', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}
//超级企业模糊查询
var search = query => {
	return new Promise((res, rej) => {
		request.post('/index/call/getsearches', query)
			.then(a => {
				res(a)
			}).catch(err => {
				rej(err)
			})
	})
}
export default{
	getusers,
	getmassage,
	adduser,
	loaded,
	getlist,
	search
}